package com.connor.bs.plm.table;

import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.Arrays;

import javax.swing.BorderFactory;
import javax.swing.JButton;
import javax.swing.JDialog;
import javax.swing.JScrollPane;
import javax.swing.plaf.basic.BasicTableUI;

import org.apache.poi.xssf.usermodel.XSSFWorkbook;

public class CTest {
	static int[] rows;
	static JScrollPane pane;
	
	public static void main(String args[]) {
		final CTMap map = new CTMap(5,5);
		final CTable table = new CTable(map);
		table.setDefaultRenderer(Object.class, new TableCellTextAreaRenderer());
		pane = new JScrollPane(table);
		JButton button = new JButton("add");
		table.setShowGrid(false);
		final JDialog dialog = new JDialog();
		dialog.setLayout(new BorderLayout());
		button.addActionListener(new ActionListener() {
			@Override
			public void actionPerformed(ActionEvent e) {
				// TODO Auto-generated method stub
				table.setRowHeight(2,50);
				table.revalidate();
				table.repaint();
				
			}
		});
		dialog.add(pane, BorderLayout.CENTER);
		dialog.add(button, BorderLayout.SOUTH);
		dialog.setPreferredSize(new Dimension(500,500));
		dialog.show();
	}
}